home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc2 / datebkiv.lha / DateBookIV / Rexx / Add_Alarm.dbk next >
Text File  |  1994-05-08  |  1KB  |  59 lines

  1. /* File : Add_Alarm.dbk
  2.  *
  3.  * $Project:          
  4.  *
  5.  * $Module Id:         
  6.  * $Author:         Robert Hardy
  7.  * $Date Started:     Thu Apr 21 1994
  8.  * $Version:         1
  9.  * $Revision         0
  10.  *
  11.  *   Add an event to CyberCrons task list.  
  12.  *     Rexx field should be: `Add_Alarm %T <lead_time> <message>'
  13.  *
  14.  *            Where:
  15.  *                    %T          - DateBook will insert the event's
  16.  *                                time field.
  17.  *                    lead_time - number of minutes prior to event 
  18.  *                                time.
  19.  *                    message   - The rest of the line contains the
  20.  *                                message to display.
  21.  *
  22.  * $History: 
  23.  *        {ver} {initial} {date} {description of change} {SAR|SCR reference #}
  24.  *
  25.  *        1.0        RWH        Thu Apr 21 1994        Initial rev
  26.  *
  27.  */
  28.  
  29. parse arg event_time lead_time message
  30.  
  31. options results
  32.  
  33. Ding = '07'X 
  34.  
  35.     /* Set up the window to display our message */
  36. window_string = '>con:10/10/400/50/Reminder/close/wait'
  37.  
  38. event_time = strip(event_time)
  39.  
  40.     /* extract time */
  41. hours = left(event_time, 2)
  42. mins = right(event_time, 2)
  43.  
  44. mins = mins - lead_time        /* Subtract lead time */
  45. do while mins < 0         /* Adjust as needed */
  46.     mins = mins + 60
  47.     hours = hours - 1
  48. end
  49.  
  50. message = Ding || Ding || message || Ding || Ding
  51. command_string = echo "'message'" 'window_string
  52.  
  53. address 'CYBERCRON'        /* talk to CyberCron's rexx port */
  54. ADD_EVENT mins' 'hours' * * * 'command_string
  55.  
  56. exit 0
  57.  
  58. /* End Add_Alarm.dbk */
  59.